// eslint-disable-next-line @typescript-eslint/no-var-requires
const chalk = require('chalk');
const log = console.log;
const error = chalk.bold.red;
const warning = chalk.keyword('orange');
module.exports = {
  // ctx.helper.log('W', 121323)
  log(state, param) {
    switch (state) {
      case 'l':
        log(`${chalk.bold.bgGreen.white('log')}-------${param}-------${chalk.bold.bgGreen.white('|')}`);
        break;
      case 'E':
        console.log(error.bold.bgRed.white('error') + `-------${param}`);
        break;
      case 'W':
        console.log(warning.bold.bgMagenta.white('Warning') + `-------${param}`);
        break;
      default:
    }
  },
  // Json sql ctx.helper.Jsonsql(req)
  Jsonsql(param) {
    return JSON.parse(JSON.stringify(param));
  },

};